package delegate

import kotlin.properties.Delegates

/**
 * @author aidenquan
 *         Created by junlintianxia on 2022/10/12.
 */
class DelegateTest {
    var observableProp: String by Delegates.observable("默认值：xxx") { property, oldValue, newValue ->
        println("property: $property: $oldValue -> $newValue ")
    }
    companion object {
        @JvmStatic
        fun main(args: Array<String>) {
            val realGamePlayer = RealGamePlayer("张三")
            val delegateGamePlayer = DelegateGamePlayer(realGamePlayer)
            delegateGamePlayer.rank()
            delegateGamePlayer.upgrade()

            val delegateTest = DelegateTest()
            delegateTest.observableProp = "第一次修改值"
            delegateTest.observableProp = "第二次修改值"
        }
    }
}